<template>
	<view>
		<block v-for="(item,index) in list" :key="index">
			<ContentTxt v-if="item.itype =='txt'" :item="item" />
			<ContentImg v-if="item.itype =='img'" :item="item" :imgs="contimgs" />
			<ContentVideo v-if="item.itype =='video'" :item="item" />
		</block>
	</view>
</template>

<script>
	import ContentTxt from "./txt.vue";
	import ContentImg from "./img.vue";
	import ContentVideo from "./video.vue";

	export default {
		components: {
			ContentTxt,
			ContentImg,
			ContentVideo,
		},
		props: {
			list: {
				default: [],
			}
		},
		computed: {
			contimgs() {
				let contimgs = [];
				this.list.map(it => {
					if (it.itype == 'img') contimgs.push(it.content);
				});
				return contimgs;
			},
		},
		methods: {

		}
	}
</script>

<style>

</style>
